<?php

namespace App\Http\Requests\Admin\V1\Device;

use App\Http\Requests\ApiRequest;
use App\Rules\ImageFile;

/**
 * Class DeviceDataRequest
 *
 * @property array descriptions
 *
 * @package App\Http\Requests\Admin\V1\Device
 */
class DeviceDataRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'manufacture_id'                 => 'required|int',
            'name'                           => 'required|string',
            'sort_order'                     => 'required|int',
            'is_show'                        => 'required|int',
            'bluetooth_code'                 => 'required|string',
            'descriptions'                   => 'required|array',
            'descriptions.*.name'            => 'required|string',
            'descriptions.*.instruction_img' => [new ImageFile],
            'descriptions.*.help_img'        => [new ImageFile],
            'product_img'                    => [new ImageFile],
            'price'                          => 'numeric',
            'luminance_min'                  => 'required|int',
            'luminance_max'                  => 'required|int',
            'color_temperature_min'          => 'required|int',
            'color_temperature_max'          => 'required|int',
            'service_uuid'                   => 'required|string',
            'read_uuid'                      => 'required|string',
            'write_uuid'                     => 'required|string'
        ];
    }
}
